<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();

if($_RQ['op']=='main'){
		$set = $this->plugin_setting('setting');
		$id = intval($_RQ['id']);
		if (empty($id)) 
		{
		/*	if (!($this->islogin)) 
			{
				$url = str_replace('./index.php?', '', mobileUrl('sns/user'));
				$loginurl = mobileUrl('account/login', array('backurl' => urlencode(base64_encode($url))));
				header('location: ' . $loginurl);
				exit();
			} */
			$member = getMember($_SESSION['uid']);
			$id=$_SESSION['uid'];
		}
		else 
		{
			$member =getMember($id);
		}
		
		
		if (empty($member)) 
		{
			exi('未找到用户!', 'error', '/index/');
		}
		$mid = $id;
		$mymid=	$_SESSION['uid'];
		$level = array('levelname' => (empty($set['levelname']) ? '社区粉丝' : $set['levelname']), 'color' => (empty($set['levelcolor']) ? '#333' : $set['levelcolor']), 'bg' => (empty($set['levelbg']) ? '#eee' : $set['levelbg']));
		if (!(empty($member['sns_level']))) 
		{
			$level = pdo_get('jy_jdk_level',array('id'=>$member['sns_level']));
		}
		
		$return['member']=$member;
		$return['mid']=$mid;
		$return['mymid']=$mymid;
		$return['level']=$level;
		$return['boardcount']=$boardcount;
		$return['postscount']=$postcount;
		$return['boards']=$boards;
		$return['followcount']=$followcount;
		$return['posts']=$posts;
		$return['replycount']=$replycount;
		$return['replys']=$replys;
		
		exi($return);
	}
?>